The last argument for both methods is the name of the
container. You use either the word "Container" or
"null." If the call to FieldValue or FieldValueAtIndex is within a
DataGrid, DataList, or Repeater tag, then use
"Container." Otherwise, use "null." In your case, you're
calling FieldValue from
the Page_Load function:
You don't have a container, so you can use "null" as the
last argument.
Note: If you are curious about the
meaning of "Container," you can look at the Microsoft
documentation for the Eval method of the DataBinder
class. The "Container" used in FieldValue and FieldValueAtIndex is identical to
the "Container" used when you call DataBinder.Eval .
You're probably wondering when to use "Container."
Here's a quick example: You have a page with DataGrid.
The data source for DataGrid is DataSet. Each row of
DataGrid corresponds to a row in DataSet. Let's say you
use DataGrid to list your e-mail addresses and you want
the text to be a mailto link to the e-mail address. You
can do this in Dreamweaver MX by changing the column
datatype from Simple Data Field to Free Form. This
allows you to use an ItemTemplate. This is where you use
the FieldValue("column",
Container) form of the
method:
|